
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using System.IO;

namespace IPickImporterUI
{
	public abstract class CustomerFavorites
	{
		private long _CustomerFavoriteID;
		private long _CustomerID;
		private long _CatalogID;
		private bool _isNew;

		#region Constructors
		
		public CustomerFavorites()
		{
			_CustomerFavoriteID = 0;
		}
		
		public CustomerFavorites(long CustomerFavoriteID) : this()
		{
			_CustomerFavoriteID = CustomerFavoriteID;
		}
	
		public CustomerFavorites(long CustomerFavoriteID, long CustomerID, long CatalogID) : this()
		{
			_CustomerFavoriteID = CustomerFavoriteID;
			_CustomerID = CustomerID;
			_CatalogID = CatalogID;
		}

		#endregion
		
		#region Properties
		
		public long CustomerFavoriteID
		{
			get	{ return _CustomerFavoriteID; }
			set	{ _CustomerFavoriteID = value; }
		}
		
		public long CustomerID
		{
			get	{ return _CustomerID; }
			set	{ _CustomerID = value; }
		}
		
		public long CatalogID
		{
			get	{ return _CatalogID; }
			set	{ _CatalogID = value; }
		}
		
		public bool IsNew
		{
			get 
			{ 
				_isNew = (_CustomerFavoriteID == 0);
				return _isNew; 
			}
			set { _isNew = value; }
		}
		
		#endregion		

		
		/// <summary>
		/// Utility function that returns a DBNull.Value if requested. The comparison is done inline
		/// in the Insert() and Update() functions.
		/// </summary>
		private object SetNullValue(bool isNullValue, object value)
		{
			if (isNullValue)
				return DBNull.Value;
			else
				return value;
		}
	}
}
